package com.sql;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class ExampleDaoGenerator {

	private static int i = 0;

	private static String[] packageName = new String[] { "com.furniture.sql"};

	private static String[] filePath = new String[] { "E:\\Git\\Furniture\\app\\src\\main\\java"};

	public static void main(String[] args) throws Exception {
		Schema schema = new Schema(1, packageName[i]);
		addGoodListItem(schema);
		new DaoGenerator().generateAll(schema, filePath[i]);
	}

	private static void addGoodListItem(Schema schema) {
		Entity mItem = schema.addEntity("Good");
		mItem.implementsSerializable();
		mItem.addIdProperty();
		mItem.addLongProperty("userId");
		mItem.addStringProperty("nickName");
		mItem.addStringProperty("icon");
		mItem.addStringProperty("goodPic");
		mItem.addStringProperty("goodMsg");
		mItem.addBooleanProperty("isLike");
		mItem.addLongProperty("likeNum");
		mItem.addStringProperty("goodUrl");
	}



	// private Long id;
	// private Long size;
	// private Long downTimes;
	// private String name;
	// private String desc;
	// private String type;
	// private String author;
	// private String picUrl1;
	// private String picUrl2;
	// private String picUrl3;
	// private String downLoadUrl;

	// private static void addNote(Schema schema)
	// {
	// Entity note = schema.addEntity("Note");
	// note.addIdProperty();
	// note.addStringProperty("text").notNull();
	// note.addStringProperty("comment");
	// note.addDateProperty("date");
	// note.addDateProperty("time");
	// note.addStringProperty("name");
	// note.addStringProperty("age");
	// }

	// private static void addCustomerOrder(Schema schema)
	// {
	// Entity customer = schema.addEntity("Customer");
	// customer.addIdProperty();
	//
	// customer.addStringProperty("name").notNull();
	//
	// Entity order = schema.addEntity("Order");
	// order.setTableName("ORDERS"); // "ORDER" is a reserved keyword
	// order.addIdProperty();

	// Property orderDate = order.addDateProperty("date").getProperty();
	// Property customerId =
	// order.addLongProperty("customerId").notNull().getProperty();
	// order.addToOne(customer, customerId);

	// ToMany customerToOrders = customer.addToMany(order, customerId);
	// customerToOrders.setName("orders");
	// customerToOrders.orderAsc(orderDate);
	// }
}
